package com.wavehi.data_access_mybatis.web.controller;

import com.wavehi.data_access_mybatis.domain.Staff;
import com.wavehi.data_access_mybatis.service.StaffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @Author WaveHi
 * @Date 19/11/2021 下午 10:27
 * @Version 1.0
 * @Contact HJBWaveHi@163.com
 * @Description
 */
@Controller
@RequestMapping("/staff")
public class StaffController {

    @Autowired
    private StaffService staffService;

    @ResponseBody
    @RequestMapping("/getAllStaffs")
    public List<Staff> getAllStaffs() {
        return staffService.getAllStaffs();
    }

    @RequestMapping("/add")
    @ResponseBody
    public void add(Staff staff) {
        staffService.add(staff);
    }
}
